package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @author Xiao
 * @date 2021/9/12
 */
public class AppForMyBatis {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = ctx.getBean(AccountService.class);
        List<Account> list = accountService.findAll();
        //[Account{id=1, name='Tom', money=1000.0}, Account{id=2, name='Jerry', money=1000.0}]
        System.out.println(list);
    }
}
